﻿using BaseData.API.Read.Applications.Commands.AppoinCommand;
using BaseData.API.Read.Dtos;
using BaseData.ErrorCode;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ApiExplorer;

namespace BaseData.API.Read.Controllers
{
    /// <summary>
    /// API预约控制器-读-预约
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AppointController : ControllerBase
    {
        /// <summary>
        /// 中介者
        /// </summary>
        IMediator mediator;
        /// <summary>
        /// 日志
        /// </summary>
        ILogger<AppointController> logger;
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="mediator">中介者</param>
        /// <param name="logger">日志</param>
        public AppointController(IMediator mediator, ILogger<AppointController> logger)
        {
            this.mediator = mediator;
            this.logger = logger;
        }
        /// <summary>
        /// 预约列表
        /// </summary>
        /// <param name="show"></param>
        /// <returns>返回查询结果</returns>
        [HttpGet]
        public Task<ApiResult<ApiPaging<AppointDTO>>> ShowAppintList([FromQuery] AppointShowCommand show)
        {
            return mediator.Send(show);
        }
      
    }
}
